package com.yyt.bloonfilter.demo;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

/**
 * @author yeyangtao
 * @date 2020/6/2 13:50
 */
public class GuavaBloomFilter {
    public static void main(String[] args) {
        BloomFilter<Integer> bf = BloomFilter.create(
                Funnels.integerFunnel(),
                //数量
                1500,
                //概率
                0.01);
        System.out.println(bf.mightContain(1));
        bf.put(1);
        System.out.println(bf.mightContain(1));
    }
}
